#!/usr/bin/env python
import atlasgen as atl
import cPickle
import sys

from optparse import OptionParser
def getParser():
    parser = OptionParser()
    parser.add_option("-g","--graph",dest='graph',
                      help='file containing graph to be compared to atlases',
                      default='')
    parser.add_option('-a','--atlas',dest='atlas',default='',
                      help='file containing atlas to compare graph with')

    return parser
       
def main():
    parser = getParser()
    (options, args) = parser.parse_args()	
    gfo = file(options.graph,'rb')
    graph = cPickle.load(gfo)
    atfo = file(options.atlas,'rb')
    atlas = cPickle.load(atfo)
    
    layermembership = atl.graph_score(graph,atlas,atl.gauss_layering)
    print "graph layermembership score:", layermembership
    
    nodemembership = atl.graph_score(graph,atlas,atl.closest_node)
    print "graph nodemembership score:", nodemembership	
    
    window = [(-30,70), (-30,70), (-30,70)]	
    scale = 6
    
    atl.plotatlasandgraph(atlas,graph,window,scale)
    
if __name__== "__main__":
	main()
#-----------------------END OF PROGRAM------------------------
